#include "StdAfx.h"
#include "GameInitInfo.h"
#include <boost/ref.hpp>

GameInitInfo::GameInitInfo(PlayerID playerID, const PlanetsInitInfoVector& planets, 
                           const PlayersInitInfoVector& players): m_playerID(playerID)
{
   if (players.size() < 2)
   {
      throw std::exception("player count must be > 1");
   }
   if (planets.size() < 2)
   {
      throw std::exception("planet count must be > 1");
   }
   if (planets.size() < players.size())
   {
      throw std::exception("planet count must be > player count");
   }
   m_planetsInitInfo.swap(boost::ref(planets));
   m_playersInitInfo.swap(boost::ref(players));
}


GameInitInfo::~GameInitInfo()
{
}

unsigned int GameInitInfo::CountOfPlayers() const
{
   return m_playersInitInfo.size();
}

unsigned int GameInitInfo::CountOfPlanets() const
{
   return m_planetsInitInfo.size();
}